#include<iostream>
#include<vector>

using namespace std;

class Solution {
public:
    vector<int>path;
    vector<vector<int>>ret;
    int n; int k;
    void dfs(int pos)
    {
        if (path.size() == k)
        {
            ret.push_back(path);
            return;
        }
        for (int i = pos; i <= n; i++)
        {
            path.push_back(i);
            dfs(i + 1);
            path.pop_back();
        }
    }
    vector<vector<int>> combine(int _n, int _k) {
        n = _n; k = _k;
        dfs(1);
        return ret;
    }
};